//
//  Labs_UIButtonHighlightedImage_DemoVC.swift
//  APSwift
//
//  Created by jianbo.pei on 2022/8/4.
//

import UIKit

class Labs_UIButtonHighlightedImage_DemoVC: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        test1()
    }
    
    private func test1() {
        let bt = UIButton(type: .custom)
        view.addSubview(bt)
        bt.setTitle("未选中", for: .normal)
//        bt.setTitle("高亮", for: .highlighted)
//        bt.setTitle("选中", for: .selected)
//        bt.setTitle("选中高亮", for: [.selected, .highlighted])
//        bt.backgroundColor = .red
        bt.showsTouchWhenHighlighted = true
        bt.frame = CGRect(x: 100, y: 200, width: 200, height: 50)
        bt.addTarget(self, action: #selector(didTappedBtAction), for: .touchUpInside)
    }
    
    @objc private func didTappedBtAction() {
        debugPrint("点开了button")
    }

}
